local jizhi = fk.CreateSkill({
  name = "mini_mou__jizhi",
})

Fk:loadTranslationTable{
  ["mini_mou__jizhi"] = "集智",
  [":mini_mou__jizhi"] = "锁定技，当你使用锦囊牌时，你摸一张牌，本回合以此法获得的牌不计入手牌上限且无次数限制。",

  ["@@mini_mou__jizhi-inhand-turn"] = "集智",

  ["$mini_mou__jizhi1"] = "神智泉涌，取之不绝。",
  ["$mini_mou__jizhi2"] = "一计再连一计。",
}

jizhi:addEffect(fk.CardUsing, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(jizhi.name) and
      data.card.type == Card.TypeTrick
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, jizhi.name, nil, "@@mini_mou__jizhi-inhand-turn")
  end,
})

jizhi:addEffect(fk.PreCardUse, {
  can_refresh = function (self, event, target, player, data)
    return target == player and data.card:getMark("@@mini_mou__jizhi-inhand-turn") > 0
  end,
  on_refresh = function(self, event, target, player, data)
    data.extraUse = true
  end,
})

jizhi:addEffect("maxcards", {
  exclude_from = function(self, player, card)
    return card:getMark("@@mini_mou__jizhi-inhand-turn") > 0
  end,
})

jizhi:addEffect("targetmod", {
  bypass_times = function (self, player, skill, scope, card, to)
    return card and card:getMark("@@mini_mou__jizhi-inhand-turn") > 0
  end,
})

return jizhi
